package com.zhengshan.demo.controller;

import com.zhengshan.demo.unit.RedisUnit;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.ListOperations;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.ValueOperations;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * todo
 *
 * @author zhengshan
 * @Date 2023/10/19 13:24
 */
@Controller
@RequestMapping(value = "/test/redis")
public class TestRedisController {

    @Autowired
    private RedisTemplate redisTemplate;

    @RequestMapping("/teststring")
    @ResponseBody
    public String TestRedisStringType(String key, String value) {
        RedisUnit redisUnit = new RedisUnit();
        redisUnit.isConnected();
        ValueOperations<String, Object> ops = redisTemplate.opsForValue();
        ListOperations<String, List> opList = redisTemplate.opsForList();
        ops.set("test", "test");
//        JSON2Excel json2Excel = new JSON2Excel();
//        json2Excel.test();
        return "test";
}


}
